package com.jqb.spring;

public class UserManagerImplProxy implements UserManager {

	private UserManager userManager;

	public UserManagerImplProxy(UserManager userManager) {
		this.userManager = userManager;
	}

	public void addUser(String username, String password) {
		//在代理类进行安全性检查
		checkSecurity();
		this.userManager.addUser(username, password);
	}

	public void deleteUser(int id) {

	}

	public String findUserById(int id) {
		return null;
	}

	public void modifyUser(int id, String username, String password) {

	}
	//安全性检查方法
	public void checkSecurity() {
		System.out.println("----checkSecurity");
	}
}
